<template>
  <div class="dmHome">
    <grid :head="gridHead" :grid="gridData" @firstColClick="itemClick"/>
  </div>
</template>
<script>
import grid from '@/components/scrollGrid'
import summary from '@/net/summary'

export default {
  name: 'summary',
  data () {
    return {
      gridHead: [
        { name: 'XZQHMC', value: '行政区划', isClick: true, isFirstClick: false},
        { name: 'JHSL_H_S', value: '计划改造户数'},
        { name: 'ZT11', value: '确户数'},
        { name: 'startWork', value: '开工总数(户/台)'},
        { name: 'JHWCL', value: '开工率'},
        { name: 'uninstall', value: '未安装(户/台)'},
        { name: 'underConstruction', value: '施工中(户/台)'},
        { name: 'install', value: '安装完毕(户/台)'},
        { name: 'AZWBL', value: '完成率'},
        { name: 'operationMonitor', value: '运行监控(户/台)'}
      ],
      gridData: []
    }
  },
  components: {
    grid
  },
  beforeCreate () {
    this.$notice.loading.show()
    this.$navigator.setLeftItem({
      text: '   ',
      fontSize: '40',
      fontWeight: 'bold'
    }, () => {
      this.$router.back()
    })
  },
  created () {
    summary.getSummary().then(res => {
      res.forEach(value => {
        value.JHWCL += '%'
        value.AZWBL += '%'
        value.startWork = value.SUMSL_H + '/' + value.SUMSL_SB
        value.uninstall = value.ZT21 + '/' + value.ZT12
        value.underConstruction = value.ZT22 + '/' + value.ZT13
        value.install = value.ZT23 + '/' + value.ZT14
        value.operationMonitor = value.ZT25 + '/' + value.ZT16
      })
      this.gridData = res
      this.$nextTick(() => {
        this.$notice.loading.hide()
      })
    })
  },
  methods: {
    itemClick (value) {
    }
  }
}
</script>
<style scoped>
.dmHome{
  width: 750px;
}
.header{
  width: 750px;
  height: 112.5px;
  background-color:rgba(62,175,252,1);
  padding-top: 10px;
}
.title{
  color: #fff;
  font-family:PingFangSC-Regular;
}
</style>
